package com.cbh.feign.controller.user;



import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.cbh.api.model.ApiResult;
import com.cbh.api.model.user.User;
import com.github.pagehelper.PageInfo;


public interface AuthUserControllerBase {

	@RequestMapping(value = "/auth/v1/app/user", method = RequestMethod.POST, produces = "application/json")
	public ApiResult<PageInfo<User>> getAllUser(
			@RequestHeader(value = "accountToken", required = false) String accountToken,
			@RequestParam(value = "accountToken", required = false) String accountToken1,
			@RequestParam(value = "keyValue", required = false) String keyValue, @RequestParam(value = "userName", required = false)String userName,
			@RequestParam(value = "phoneNumber", required = false)String phoneNumber, @RequestParam(value = "startLine", required = false)Integer startLine, @RequestParam(value = "endLine", required = false)Integer endLine);

	@RequestMapping(value = "/auth/v1/app/user/{userPhoneNumber}", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<User> getUserByPhone(@RequestHeader(value = "accountToken", required = false) String accountToken,
			@RequestParam(value = "accountToken", required = false) String accountToken1,
			@PathVariable("userPhoneNumber") String userPhoneNumber);

	@RequestMapping(value = "/auth/v1/app/user/getUserByID", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<User> getUserByID(@RequestHeader(value = "accountToken", required = false) String accountToken,
			@RequestParam(value = "accountToken", required = false) String accountToken1,
			@RequestParam(value = "userId", required = true) String userId);

	/**
	 * 根据手机号验证码修改密码
	 * 
	 * @param phoneNumber
	 * @param password
	 * @param validation
	 * @return
	 */
	@RequestMapping(value = "/auth/v1/app/user/editByPhoneAndCode", method = RequestMethod.POST)
	public ApiResult<User> editByPhone(@RequestHeader(value = "accountToken", required = false) String accountToken,
			@RequestParam(value = "accountToken", required = false) String accountToken1,
			@RequestParam(value = "userAccount", required = true) String userAccount,
			@RequestParam(value = "password", required = true) String password,
			@RequestParam(value = "verification", required = true) String validation);

	/**
	 * 根据ID进行修改操作
	 * 
	 * @param accountToken
	 * @param duId
	 * @param phoneNumber
	 * @param name
	 * @param sex
	 * @param pic
	 * @param idCard
	 * @param password
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/auth/v1/app/user/edit", method = RequestMethod.POST)
	public ApiResult<User> editById(@RequestHeader(value = "accountToken", required = false) String accountToken,
			@RequestParam(value = "accountToken", required = false) String accountToken1,
			@RequestParam(value = "name", required = false) String name,
			@RequestParam(value = "sex", required = false) String sex,
			@RequestParam(value = "pic", required = false) String pic,
			@RequestParam(value = "idCard", required = false) String idCard);

	/**
	 * app用户升级为后台管理员
	 * 
	 * @param accountToken
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/auth/v1/app/user/AppToManager", method = RequestMethod.POST)
	public ApiResult<User> AppToManager(@RequestHeader(value = "accountToken", required = false) String accountToken,
			@RequestParam(value = "accountToken", required = false) String accountToken1);

}
